Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Selective Hydration] Increase priority for non-synchronous discrete events and retries #16935

Merged
merged 2 commits into from Sep 28, 2019

Conversation

sebmarkbage
Copy link
Collaborator

If an increased priority dehydrated boundary commits as dehydrated because it is suspended, it no longer has any expirationTime scheduled. So when the thenable resolves, it gets the default priority. This increases the retryTime. This will almost immediately expire and effectively become sync. We might want to make this slightly higher than Normal but longer expiration time.

The upside of eagerly computing this (as opposed to when resolved) is that we can guarantee a predictable order of priorities. (First event in, highest pri.)

This PR also ensures that we increase the priority of subsequent events after the first can't be done synchronously. There's no reason to keep them as high as sync since at that point it is already too late since replaying has kicked in. So we schedule with user blocking pri for this case.

@sizebot
Copy link

sizebot commented Sep 27, 2019

ReactDOM: size: 0.0%, gzip: 0.0%

Details of bundled changes.

Comparing: 3694a3b...3381578

react-dom

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-dom.profiling.min.js +0.2% +0.3% 120.78 KB 120.97 KB 38.03 KB 38.15 KB NODE_PROFILING
react-dom-server.browser.development.js 0.0% 0.0% 142.24 KB 142.24 KB 37.13 KB 37.13 KB UMD_DEV
ReactDOM-dev.js +0.2% +0.2% 980.3 KB 982.01 KB 216.51 KB 216.93 KB FB_WWW_DEV
react-dom-server.browser.production.min.js 0.0% 0.0% 19.86 KB 19.86 KB 7.37 KB 7.38 KB UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 57.54 KB 57.54 KB 15.83 KB 15.83 KB UMD_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.78 KB 3.78 KB 1.53 KB 1.53 KB UMD_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 11.19 KB 11.19 KB 4.16 KB 4.16 KB UMD_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.1% 1.2 KB 1.2 KB 702 B 703 B UMD_PROD
react-dom-test-utils.development.js 0.0% 0.0% 55.81 KB 55.81 KB 15.5 KB 15.5 KB NODE_DEV
react-dom-unstable-fizz.browser.development.js 0.0% +0.1% 3.61 KB 3.61 KB 1.48 KB 1.48 KB NODE_DEV
react-dom-test-utils.production.min.js 0.0% -0.0% 10.96 KB 10.96 KB 4.09 KB 4.09 KB NODE_PROD
react-dom-unstable-fizz.browser.production.min.js 0.0% 🔺+0.2% 1.04 KB 1.04 KB 633 B 634 B NODE_PROD
react-dom.development.js +0.2% +0.2% 955.06 KB 956.77 KB 215.54 KB 215.96 KB UMD_DEV
react-dom.production.min.js 🔺+0.2% 🔺+0.3% 117.07 KB 117.25 KB 37.7 KB 37.81 KB UMD_PROD
react-dom.profiling.min.js +0.1% +0.3% 120.61 KB 120.79 KB 38.72 KB 38.83 KB UMD_PROFILING
react-dom.development.js +0.2% +0.2% 949.11 KB 950.82 KB 213.99 KB 214.42 KB NODE_DEV
react-dom-server.node.development.js 0.0% 0.0% 139.19 KB 139.19 KB 36.36 KB 36.36 KB NODE_DEV
react-dom.production.min.js 🔺+0.2% 🔺+0.3% 117.09 KB 117.29 KB 36.95 KB 37.07 KB NODE_PROD
react-dom-server.node.production.min.js 0.0% 0.0% 20.2 KB 20.2 KB 7.52 KB 7.52 KB NODE_PROD
ReactDOM-prod.js 🔺+0.3% 🔺+0.3% 392.69 KB 393.79 KB 71.54 KB 71.77 KB FB_WWW_PROD
ReactDOM-profiling.js +0.3% +0.3% 398.99 KB 400.1 KB 72.67 KB 72.89 KB FB_WWW_PROFILING
react-dom-server.browser.production.min.js 0.0% 0.0% 19.79 KB 19.79 KB 7.36 KB 7.36 KB NODE_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.73 KB 60.73 KB 15.85 KB 15.85 KB UMD_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.74 KB 10.74 KB 3.67 KB 3.67 KB UMD_PROD
ReactDOMServer-dev.js 0.0% 0.0% 142.15 KB 142.15 KB 35.62 KB 35.62 KB FB_WWW_DEV
ReactDOMServer-prod.js 0.0% 0.0% 48.24 KB 48.24 KB 11.04 KB 11.04 KB FB_WWW_PROD
react-dom-unstable-native-dependencies.development.js 0.0% 0.0% 60.4 KB 60.4 KB 15.73 KB 15.73 KB NODE_DEV
react-dom-unstable-fizz.node.development.js 0.0% +0.1% 3.87 KB 3.87 KB 1.51 KB 1.51 KB NODE_DEV
react-dom-unstable-native-dependencies.production.min.js 0.0% 0.0% 10.49 KB 10.49 KB 3.57 KB 3.57 KB NODE_PROD
react-dom-unstable-fizz.node.production.min.js 0.0% 🔺+0.3% 1.1 KB 1.1 KB 667 B 669 B NODE_PROD

react-reconciler

File Filesize Diff Gzip Diff Prev Size Current Size Prev Gzip Current Gzip ENV
react-reconciler.development.js +0.2% +0.3% 602.44 KB 603.78 KB 127.24 KB 127.58 KB NODE_DEV
react-reconciler.production.min.js 🔺+0.3% 🔺+0.4% 71.4 KB 71.62 KB 21.11 KB 21.2 KB NODE_PROD
react-reconciler-reflection.development.js 0.0% 0.0% 20.17 KB 20.17 KB 6.5 KB 6.5 KB NODE_DEV
react-reconciler-reflection.production.min.js 0.0% 🔺+0.2% 2.88 KB 2.88 KB 1.25 KB 1.25 KB NODE_PROD
react-reconciler-persistent.development.js +0.2% +0.3% 599.45 KB 600.79 KB 125.97 KB 126.32 KB NODE_DEV
react-reconciler-persistent.production.min.js 🔺+0.3% 🔺+0.4% 71.41 KB 71.63 KB 21.12 KB 21.21 KB NODE_PROD

Generated by 🚫 dangerJS against 3381578

await promise;

// After the click, we should prioritize D and the Click first,
// and only after that render A and C.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you copy-pasted this comment but forgot to update it

@sebmarkbage sebmarkbage merged commit fe31cc7 into facebook:master Sep 28, 2019
@trueadm
Copy link
Contributor

trueadm commented Sep 28, 2019

I wonder, would this have future affects on Flare? It doesn't matter right now, but if you think it does a test that is skipped for Flare would be useful.

@sebmarkbage
Copy link
Collaborator Author

sebmarkbage commented Sep 28, 2019

The way I'm thinking about it is that we're testing the interaction between event system <-> replaying system in PartialHydration file which has tests for both. In this, SelectiveHydration, file we're testing the interaction between event replaying <-> reconciler priorities. We're actually testing the reconciler here, more than the events themselves. So we don't need to duplicate every combination of these tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants